import Vue from 'vue'
import VueRouter from 'vue-router'
Vue.prototype.$router = VueRouter
Vue.use(VueRouter)
const originalPush = VueRouter.prototype.push

VueRouter.prototype.push = function push (location) {
  return originalPush.call(this, location).catch(err => err)
}

const routes = [
  {
    path: '/',
    redirect: '/comprehensive'
  },
  {
    path: '/dataSea',
    name: 'DataSea',
    component: () => import('../views/dataSea/DataSea')
  },
  {
    path: '/comprehensive',
    name: 'Comprehensive',
    component: () => import('../views/comprehensive/Comprehensive.vue'),
    children: [
 /*     {
        path: '/comprehensive',
        name: 'Comprehensive',
        component: () => import('../views/comprehensive/Comprehensive.vue')
      },*/
      {
        path: '/dataSea',
        name: 'DataSea',
        component: () => import('../views/dataSea/DataSea')
      },
      {
        path: 'analysisAndJudgement',
        name: 'AnalysisAndJudgement',
        component: () => import('../views/dataSea/fxyp/AnalysisAndJudgement.vue')
      }
    ]
  }
]

const router = new VueRouter({
  mode: 'hash',
  base: process.env.BASE_URL,
  routes
})

export default router
